package cn.wolfcode.trip.admin.controller;


import cn.wolfcode.trip.base.domain.Message;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.service.IMessageService;
import cn.wolfcode.trip.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("message")
public class MessageController {
    @Autowired
    private IMessageService messageService;

    @RequestMapping("/saveOrUpdate")
    @ResponseBody
    public Object insertMessage(Message message,Long state){

        JSONResult jsonResult = new JSONResult();
        try {
            //保存系统通知的记录
            //指定发送系统通知的人
            User user = new User();
            user.setId(9L);
            message.setUser(user);
        }catch (Exception e){
            e.printStackTrace();
            jsonResult.setMsg(e.getMessage());
        }
        return jsonResult;
    }
}
